home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xfig.idb / usr / freeware / src / xfig / xfig.3.1.4 / resources.c.z / resources.c
Encoding:
C/C++ Source or Header  |  1997-09-09  |  5.0 KB  |  166 lines

  1. /*
  2.  * FIG : Facility for Interactive Generation of figures
  3.  * Copyright (c) 1985 by Supoj Sutanthavibul
  4.  * Parts Copyright (c) 1991 by Paul King
  5.  * Parts Copyright (c) 1994 by Brian V. Smith
  6.  *
  7.  * The X Consortium, and any party obtaining a copy of these files from
  8.  * the X Consortium, directly or indirectly, is granted, free of charge, a
  9.  * full and unrestricted irrevocable, world-wide, paid up, royalty-free,
  10.  * nonexclusive right and license to deal in this software and
  11.  * documentation files (the "Software"), including without limitation the
  12.  * rights to use, copy, modify, merge, publish, distribute, sublicense,
  13.  * and/or sell copies of the Software, and to permit persons who receive
  14.  * copies from any such party to do so, with the only requirement being
  15.  * that this copyright notice remain intact.  This license includes without
  16.  * limitation a license to do the foregoing actions under any patents of
  17.  * the party supplying this software to the X Consortium.
  18.  */
  19.  
  20. #include "fig.h"
  21. #include "resources.h"
  22.  
  23. fig_colors       colorNames[] = {
  24.             "Default",    "NULL",
  25.             "Black",    "black",
  26.             "Blue",        "blue",
  27.             "Green",    "green",
  28.             "Cyan",        "cyan",
  29.             "Red",        "red",
  30.             "Magenta",    "magenta",
  31.             "Yellow",    "yellow",
  32.             "White",    "white",
  33.             "Blue4",    "#000090",    /* NOTE: hex colors must be 6 digits */
  34.             "Blue3",    "#0000b0",
  35.             "Blue2",    "#0000d0",
  36.             "LtBlue",    "#87ceff",
  37.             "Green4",    "#009000",
  38.             "Green3",    "#00b000",
  39.             "Green2",    "#00d000",
  40.             "Cyan4",    "#009090",
  41.             "Cyan3",    "#00b0b0",
  42.             "Cyan2",    "#00d0d0",
  43.             "Red4",        "#900000",
  44.             "Red3",        "#b00000",
  45.             "Red2",        "#d00000",
  46.             "Magenta4",    "#900090",
  47.             "Magenta3",    "#b000b0",
  48.             "Magenta2",    "#d000d0",
  49.             "Brown4",    "#803000",
  50.             "Brown3",    "#a04000",
  51.             "Brown2",    "#c06000",
  52.             "Pink4",    "#ff8080",
  53.             "Pink3",    "#ffa0a0",
  54.             "Pink2",    "#ffc0c0",
  55.             "Pink",        "#ffe0e0",
  56.             "Gold",        "gold" };
  57.  
  58. char        *short_clrNames[] = {
  59.             "Default", 
  60.             "Blk", "Blu", "Grn", "Cyn", "Red", "Mag", "Yel", "Wht",
  61.             "Bl4", "Bl3", "Bl2", "LBl", "Gr4", "Gr3", "Gr2",
  62.             "Cn4", "Cn3", "Cn2", "Rd4", "Rd3", "Rd2",
  63.             "Mg4", "Mg3", "Mg2", "Br4", "Br3", "Br2",
  64.             "Pk4", "Pk3", "Pk2", "Pnk", "Gld" };
  65.  
  66. /* original directory where xfig started */
  67. char    orig_dir[PATH_MAX+2];
  68.  
  69. #ifdef USE_XPM
  70. XpmAttributes    xfig_icon_attr;
  71. #endif
  72. Pixel        colors[NUM_STD_COLS+MAX_USR_COLS];
  73. XColor        user_colors[MAX_USR_COLS];
  74. XColor        undel_user_color;
  75. XColor        n_user_colors[MAX_USR_COLS];
  76. XColor        save_colors[MAX_USR_COLS];
  77. int        num_usr_cols=0;
  78. int        n_num_usr_cols;
  79. int        current_memory;
  80. Boolean        colorUsed[MAX_USR_COLS];
  81. Boolean        colorFree[MAX_USR_COLS];
  82. Boolean        n_colorFree[MAX_USR_COLS];
  83. Boolean        all_colors_available;
  84.  
  85. /* number of colors we want to use for pictures */
  86. /* this will be determined when the first picture is used.  We will take
  87.    min(number_of_free_colorcells, 100, appres.maximagecolors) */
  88.  
  89. int        avail_image_cols = -1;
  90.  
  91. /* colormap used for same */
  92. XColor        image_cells[MAXCOLORMAPSIZE];
  93.  
  94. appresStruct    appres;
  95. Window        real_canvas, canvas_win, msg_win, sideruler_win, topruler_win;
  96.  
  97. Cursor        cur_cursor;
  98. Cursor        arrow_cursor, bull_cursor, buster_cursor, crosshair_cursor,
  99.         null_cursor, pencil_cursor, pick15_cursor, pick9_cursor,
  100.         panel_cursor, l_arrow_cursor, lr_arrow_cursor, r_arrow_cursor,
  101.         u_arrow_cursor, ud_arrow_cursor, d_arrow_cursor, wait_cursor,
  102.         magnify_cursor;
  103.  
  104. Widget        tool;
  105. XtAppContext    tool_app;
  106.  
  107. Widget        canvas_sw, ps_fontmenu, /* printer font menu tool */
  108.         latex_fontmenu,        /* printer font menu tool */
  109.         msg_form, msg_panel, name_panel, cmd_panel, mode_panel, 
  110.         d_label, e_label, mousefun,
  111.         ind_panel, upd_ctrl,    /* indicator panel */
  112.         unitbox_sw, sideruler_sw, topruler_sw;
  113.  
  114. Display           *tool_d;
  115. Screen           *tool_s;
  116. Window        tool_w;
  117. int        tool_sn;
  118. int        tool_cells;
  119. Colormap    tool_cm, newcmap;
  120. Boolean        swapped_cmap = False;
  121. Atom        wm_delete_window;
  122.  
  123. GC        gc, button_gc, ind_button_gc, mouse_button_gc,
  124.         fill_color_gc, pen_color_gc, blank_gc, ind_blank_gc, 
  125.         mouse_blank_gc, gccache[NUMOPS],
  126.         fillgc, fill_gc[NUMFILLPATS],    /* fill style gc's */
  127.         tr_gc, tr_xor_gc, tr_erase_gc,    /* for the rulers */
  128.         sr_gc, sr_xor_gc, sr_erase_gc;
  129.  
  130. Pixmap        fill_pm[NUMFILLPATS],fill_but_pm[NUMPATTERNS];
  131. XColor        x_fg_color, x_bg_color;
  132. Boolean        writing_bitmap;        /* set when exporting to monochrome bitmap */
  133. Boolean        writing_pixmap;        /* set when exporting to other pixmap formats */
  134. unsigned long    but_fg, but_bg;
  135. unsigned long    ind_but_fg, ind_but_bg;
  136. unsigned long    mouse_but_fg, mouse_but_bg;
  137.  
  138. /* will be filled in with environment variable XFIGTMPDIR */
  139. char           *TMPDIR;
  140.  
  141. /***** translations used for asciiTextWidgets in general windows *****/
  142. char  *text_translations =
  143.     "<Key>Return: no-op(RingBell)\n\
  144.     Ctrl<Key>J: no-op(RingBell)\n\
  145.     Ctrl<Key>M: no-op(RingBell)\n\
  146.     Ctrl<Key>X: EmptyTextKey()\n\
  147.     Ctrl<Key>U: multiply(4)\n\
  148.     <Key>F18: PastePanelKey()\n";
  149.  
  150. /* for w_export.c and w_print.c */
  151.  
  152. char    *orient_items[] = {
  153.     "portrait ",
  154.     "landscape"};
  155.  
  156. char    *just_items[] = {
  157.     "Centered  ",
  158.     "Flush left"};
  159.  
  160. /* for w_file.c and w_export.c */
  161.  
  162. char    *offset_unit_items[] = {
  163.         " Inches  ", " Centim. ", "Fig Units" };
  164.  
  165. int    RULER_WD;
  166.